The present invention provides a method and apparatus for providing improved foreground/background separation in a digital image.
A focus map may be built using a depth from defocus (DFD) algorithm, for example, as disclosed in “Rational Filters for Passive Depth from Defocus” by Masahiro Watanabe and Shree K. Nayar (1995), hereby incorporated by reference. The basic idea is that a depth map of a given scene can be theoretically computed from two images of the same scene. Ideally, for calculating a DFD map, a telecentric lens is used, and only focus varies between the two image acquisitions. This is generally not true of existing digital cameras.
Another technique for separating foreground from background is disclosed in US published patent application no. 2006/0285754, which is assigned to the same assignee as the present application, and is hereby incorporated by reference. Here, the difference in exposure levels between flash and non-flash images of a scene are used to provide a foreground/background map. The main advantage of using depth from defocus over a flash/non-flash based technique, is that depth from defocus is independent of the scene illumination and so can be advantageous for outdoor or well-illuminated scenes.
A further technique for separating foreground from background is disclosed in U.S. patent applications No. 60/773,714 and Ser. No. 11/573,713, which are hereby incorporated by reference. Here, a difference in high frequency coefficients between corresponding regions of images of a scene taken at different focal lengths are used to provide a foreground/background map. Again in this case, the foreground/background map is independent of the scene illumination and so this technique can be useful for outdoor or well-illuminated scenes.
In any case, the foreground/background map produced by each of the above techniques or indeed any other technique may not work correctly. It is thus desired to provide improved methods of foreground/background separation in a digital image.